home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
151-175
/
scopedisk168
/
asmmacros
/
am_02
/
read.i
< prev
next >
Wrap
Text File
|
1995-03-19
|
2KB
|
95 lines
NOLIST
Read MACRO ; 25 Dec 88
*------------------------------; Start of Read macro.
; Put the file handle in D1.
NOLIST
IFEQ ReEntrant-1
LIST
MOVE.L \1(A5),D1
NOLIST
ENDC
IFNE ReEntrant-1
LIST
MOVE.L \1,D1
NOLIST
ENDC
LIST
; Make D2 point to the start of the buffer.
NOLIST
IFC '\2','D'
LIST
MOVE.L #\3,D2
NOLIST
IFEQ ReEntrant-1
LIST
ADD.L A5,D2
NOLIST
ENDC
ENDC
IFC '\2','I'
IFEQ ReEntrant-1
LIST
MOVE.L \3.Adr(A5),D2
NOLIST
ENDC
IFNE ReEntrant-1
LIST
MOVE.L \3.Adr,D2
NOLIST
ENDC
ENDC
IFEQ NARG-3 ; If there is no fourth argument, and
IFC '\2','D' ; <BufferStartAddr> is specified, then
LIST
; Calculate the buffer size as
; <BufferStartAddr>End minus
; <BufferStartAddr>. Put it in D3.
MOVE.L #\3End-\3,D3
NOLIST
ENDC
IFC '\2','I' ; If <MemBlockName> is specified, then
LIST
; Get the buffer size from <MemBlockName>.Size
NOLIST
IFEQ ReEntrant-1
LIST
MOVE.L \3.Size(A5),D3
NOLIST
ENDC
IFNE ReEntrant-1
LIST
MOVE.L \3.Size,D3
NOLIST
ENDC
ENDC
ENDC
IFEQ NARG-4 ; If the fourth argument exists,
IFNC '\4','D3' ; and it is not "D3", then
LIST
; Use the buffer size of the fourth argument.
MOVE.L #\4,D3
NOLIST
ENDC
ENDC
LIST
CallLib Read,dos ; Call Read.
; Store the actual length read at \3.Len .
NOLIST
IFEQ ReEntrant-1
LIST
DefDS \3.Len,1
MOVE.L D0,\3.Len(A5)
NOLIST
ENDC
IFNE ReEntrant-1
LIST
DS_BSS \3.Len,1,.L
MOVE.L D0,\3.Len
NOLIST
ENDC
LIST
CMPI.L #-1,D0 ; Make the zero flag indicate failure.
*------------------------------; End of Read macro.
ENDM
LIST